import request from "@/utils/request";

// 查询用户信息列表
export function listUserInfo(query) {
  return request({
    url: "/userInfo/userInfo/list",
    method: "get",
    params: query,
  });
}

// 查询用户信息详细
export function getUserInfo(userId, sysUserId) {
  return request({
    url: "/userInfo/userInfo/" + userId + "/" + sysUserId,
    method: "get",
  });
}

// 新增用户信息
export function addUserInfo(data) {
  return request({
    url: "/userInfo/userInfo",
    method: "post",
    data: data,
  });
}

// 修改用户信息
export function updateUserInfo(data) {
  return request({
    url: "/userInfo/userInfo",
    method: "put",
    data: data,
  });
}

// 删除用户信息
export function delUserInfo(userId) {
  return request({
    url: "/userInfo/userInfo/" + userId,
    method: "delete",
  });
}

// 冻结用户状态
export function freezeStatusUserInfo(row) {
  return request({
    url: "/userInfo/userInfo/freezeStatus",
    method: "post",
    data: row,
  });
}

// 冻结用户余额卡量
export function freezeAccount(row) {
  return request({
    url: "/userInfo/userInfo/freezeAccount",
    method: "post",
    data: row,
  });
}

// 解冻用户状态
export function unFreezeStatus(row) {
  return request({
    url: "/userInfo/userInfo/unFreezeStatus",
    method: "post",
    data: row,
  });
}

// 获取用户信息统计
export function totalUserInfo(startTime, endTime) {
  return request({
    url: '/userInfo/userInfo/totalUserInfo',
    method: 'get',
    params: {
      startTime: startTime,
      endTime: endTime,
    }
  })
}

// 修改用户密码
export function updateUserPwd(row) {
  return request({
    url: '/userInfo/userInfo/updatePwd',
    method: 'post',
    data: row,
  })
}

